<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>钉钉景点</title>
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="../../lib/jq-module/jquery.particleground.min.js" charset="utf-8"></script>
    <style>
        body{
            background-image: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
        }
    </style>
</head>

<body>
    <div class="layui-container">
        <ul class="layui-nav layui-bg-green " lay-filter="">
            <li class="layui-nav-item layui-this"><a href="welcome.html" target="content-iframe">首页</a></li>
            <li class="layui-nav-item "><a href="spotInfo.html" target="content-iframe">景点信息</a></li>
            <li class="layui-nav-item "><a href="notice.html" target="content-iframe">系统公告</a></li>
            <li class="layui-nav-item" id="login" style="float: right;"><a href="login.html"
                    target="content-iframe">登录</a></li>
            <li class="layui-nav-item" id="logout" onclick="logout()" style="float: right;"><a href="welcome.html"
                    target="content-iframe">注销</a></li>
        </ul>
        <!-- 主体内容 -->
        <iframe src="welcome.html" name="content-iframe" width="100%" height="600px"></iframe>
        <h3 style="text-align: center;color: red;">copyright-dingding</h3>
    </div>
    <script>

        var userInfo = localStorage.getItem("userInfo");
        // 判断是否登录
        if (userInfo != null) {
            $("#login").css("display", "none");
            $("#logout").css("display", "block");
            console.log("userInfo不为空");
        } else {
            $("#logout").css("display", "none");
            $("#login").css("display", "block");
            console.log("userInfo为空");
        }

        // 注销
        function logout() {
            localStorage.removeItem("userInfo");
            $("#logout").css("display", "none");
            $("#login").css("display", "block");
            windows.location.href = "index.html";
        }

        // 使用Layui的JavaScript代码
        layui.use(['element'], function () {
            var element = layui.element;
        });
    </script>
</body>

</html>